#!/bin/bash

#----------------------------------------------------
#通过99乘法表学习shell的基本用法
#number2=$((a**3+b**3+c**3))
#  a**3就是a^3
#echo -en "$i*$j=$(($i*$j))\t"
#  $跟两个小括号，括号里是算法，表示运算；前面就不是运算
#----------------------------------------------------

for i in {1..9} ; do
    for((j=1;j<=i;j++));do
      echo -en "$i*$j=$(($i*$j))\t"
    done
    echo ""
done

for a in {1..9} ; do
    for b in {0..9} ; do
        for c in {0..9} ; do
            number1=$((a*100+b*10+c))
            number2=$((a**3+b**3+c**3))
            if test $number1 -eq $number2;then
              echo "Found number $number1"
              echo "a--b--c: $a--$b--$c"
            fi
        done
    done
done